
	function Drag(id){
		var _this = this;

		this.disX = 0;
		this.disY = 0;
		this.oDiv = document.getElementById(id);
		
		this.oDiv.onmousedown = function(){
			_this.fnDown();	

			this.setCapture && this.setCapture();
			return false;
		};
	}

	Drag.prototype.fnDown = function (ev){
		var ev = ev || event;
		var _this = this;

		this.disX = ev.clientX - this.oDiv.offsetLeft;
		this.disY = ev.clientY - this.oDiv.offsetTop;

		document.onmousemove = function (){
			_this.fnMove();
		};

		document.onmouseup = function (){
			_this.fnUp();
		};
	}	

	Drag.prototype.fnMove = function (ev){
		var ev = ev || event;
		var L = ev.clientX - this.disX;
		var T = ev.clientY - this.disY;

		this.oDiv.style.left = L + 'px';
		this.oDiv.style.top = T + 'px';
	}

	Drag.prototype.fnUp = function (){
		document.onmousemove = document.onmouseup = null;
		this.oDiv.releaseCapture && this.oDiv.releaseCapture();
	}